package controller;

import dao.MoveDao;
import java.io.File;
import org.apache.commons.io.FileUtils;
import ui.ICommand;

public class CutCommand implements ICommand {

    private String source;
    private String dest;

    public CutCommand(String source, String dest) {
        this.source = source;
        this.dest = dest;
    }

    @Override
    public void perform() {
        CopyCommand paste = new CopyCommand(source, dest);
        paste.perform();
        DeleteController dlt = new DeleteController();
        dlt.deleteFile(source);
    }

    @Override
    public void redo() {
        perform();
    }

    @Override
    public void undo() {
        MoveDao move = new MoveDao();
        move.move(dest, source);
//       File f = new File(source);
//        dest = dest + "\\" + f.getName();
//        DeleteController dlt = new DeleteController();
//        dlt.deleteFile(dest);
        
        
        

    }
}
